toolcache

object toolcache

Wrappers for @actions/tool-cache.

Functions

cacheDir
Link copied to clipboard
suspend fun cacheDir(sourceDir: Path, tool: String, version: String, arch: String? = null): Path
Caches a directory and installs it into the tool cacheDir.
cacheFile
Link copied to clipboard
suspend fun cacheFile(sourceFile: Path, tool: String, version: String, arch: String? = null, targetFile: String = sourceFile.name): Path
Caches a downloaded file (GUID) and installs it into the tool cache with a given targetNameThe cache will be keyed on tool, version, and arch, and the file will be put at targetFile inside that cache.
downloadTool
Link copied to clipboard
suspend fun downloadTool(url: String, dest: Path? = null, auth: String? = null, headers: HeaderProvider = HeaderProvider { }): Path
Download a tool from an url and stream it into a file
evaluateVersions
Link copied to clipboard
fun evaluateVersions(versions: List<String>, versionSpec: String): String?
Get the highest satisfiying semantic version in versions which satisfies versionSpec, or null if there isn't one.
extract
Link copied to clipboard
suspend fun extract(file: Path, dest: Path? = null): Path
Extract an archive, looking at the file extension and using existing autodetection capabilities (i.e.
extract7z
Link copied to clipboard
suspend fun extract7z(file: Path, dest: Path? = null, _7zPath: Path? = null): Path
Extract a .
extractTar
Link copied to clipboard
suspend fun extractTar(file: Path, dest: Path? = null, vararg flags: String = arrayOf("xz")): Path
Extract a compressed tar archive
extractXar
Link copied to clipboard
suspend fun extractXar(file: Path, dest: Path? = null, vararg flags: String): Path
Extract a xar compatible archiveMAC ONLY
extractZip
Link copied to clipboard
suspend fun extractZip(file: Path, dest: Path? = null): Path
Extract a zip
find
Link copied to clipboard
fun find(toolName: String, versionSpec: String, arch: String? = null): Path?
Finds the path to a tool version in the local installed tool cache, or null if no matching versions were found.
findAll
Link copied to clipboard
fun findAll(toolName: String, arch: String? = null): List<VersionedTool>
Finds all versions and paths of a tool that are installed in the local tool cache
findAllVersions
Link copied to clipboard
fun findAllVersions(toolName: String, arch: String? = null): List<String>
Finds all versions of a tool that are installed in the local tool cache
findFromManifest
Link copied to clipboard
suspend fun findFromManifest(versionSpec: String, stable: Boolean, manifest: List<IToolRelease>, archFilter: String = os.arch()): IToolRelease?
getManifestFromRepo
Link copied to clipboard
suspend fun getManifestFromRepo(owner: String, repo: String, auth: String? = null, branch: String = "master"): List<IToolRelease>
isExplicitVersion
Link copied to clipboard
fun isExplicitVersion(versionSpec: String): Boolean
Check if version string is explicit
load
Link copied to clipboard
inline suspend fun load(name: String, version: String, arch: String? = null, addToPath: Boolean = false, download: (version: String) -> Path): Path
Load the tool from cache if it is cached, otherwise download and cache it.

Sources

js source
Link copied to clipboard